<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>reject</title>
</head>
<body>
    
</body>
<script>
    new Promise((resolve,reject)=>{
        resolve("ok")
    })
    .then(value=>{
        // return value 与下面等价 返回的是处理成功的状态
        // return new Promise(resolve=>{
        //     resolve(value)
        // })

        // 返回失败状态(改变了本次的promise处理状态)
        // return Promise.reject(value)
        return new Promise((resolve,reject)=>{
            reject(value)
        })

    })
    .then(value=>{
        console.log("value: "+value)
    })
    .catch(err=>{
        console.log("err: "+err)
    })
</script>
</html>